string_is_alphanumeric

This function returns a boolean value showing whether the passed string contains letters and numbers.

bool string_is_alphanumeric(string the_string)

Parameters:
the_string
The string that will be evaluated.

Return value:
Returns true if the string contains letters and/or numbers, false if not or if an error occurred.

Remarks:
This function does not evaluate punctuation. If the string contains punctuation this function will return false.

Example:
void main()
{
string text1, text2;
text1="I am normal text.";
text2="Randomness15";
if(string_is_alphanumeric(text1))
{
alert("string_is_alphanumeric test", "text1 contains letters and numbers.");
}
else
{
alert("string_is_alphanumeric test", "text1 does not contain only letters and numbers.");
}
if(string_is_alphanumeric(text2))
{
alert("string_is_alphanumeric test", "text2 contains letters and numbers.");
}
else
{
alert("string_is_alphanumeric test", "text2 does not contain only letters and numbers.");
}
}